package com.lagou.biz.impl;


import com.lagou.biz.BusinessBiz;

import com.lagou.dao.BusinessDao;

import com.lagou.dao.impl.BusinessDaoImpl;

import com.lagou.entity.Business;

public class BusinessBizImpl implements BusinessBiz{
BusinessDao dao=new BusinessDaoImpl();
	@Override
	public Business login(String email, String pwd) {
		
	         return dao.login(email, pwd);
	     
	      
	}
	@Override
	public boolean add(Business u) {
		String regex = "[1-9][0-9]{8,10}\\@[q][q]\\.[c][o][m]";
		if (u.getBemail().matches(regex)&&u.getBpwd().length()>2) {
			return dao.add(u);
		}else {
			return false;
		}
	}
	@Override
	public boolean queryByEmail(Business u) {
		// TODO Auto-generated method stub
		return dao.queryByEmail(u);
	}
	@Override
	public boolean updateByEmail(Business u) {
		// TODO Auto-generated method stub
		return dao.updateByEmail(u);
	}
	@Override
	public boolean updatebpwdByemail(String email, String pwd) {
		// TODO Auto-generated method stub
		return dao.updatebpwdByemail(email, pwd);
	}
	
}
